package com.qys.livesMall.shop.modal.dto.task.app;

import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qys.livesMall.shop.modal.dto.task.app.child.SellTaskSaveChild;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;


import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class ShopSellTaskSaveDTO {

    @Schema(description = "带货任务编号")
    private Long id;

    @Schema(description = "任务名称（不超过36字符）")
    @NotBlank(message = "请输入任务名称")
    @Length(max = 36,message = "{任务名称不超过36字符}")
    private String taskName;

    @Schema(description = "任务目标（不超过128字符）")
    //@NotBlank(message = "{请输入任务目标}")
    @Length(max = 128,message = "{任务目标不超过128字符}")
    private String taskGoal;

    @Schema(description = "任务描述（不超过128字符）")
    @NotBlank(message = "请输入任务描述")
    @Length(max = 128,message = "{任务描述不超过128字符}")
    private String taskInfo;

    @Schema(description = "任务收益（平台结算）")
    @NotBlank(message = "{请输入任务收益}")
    private String taskBenefitType;

    @Schema(description = "任务时长（平台设定)")
    @NotBlank(message = "请输入任务时长")
    private String taskDuration;

    @Schema(description = "任务开始时间（当前时间之后）",example = "2023-04-24")
    @NotNull(message = "请选择任务开始时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd")
    private LocalDate taskStartTime;

    @Schema(description = "任务结束时间（开始时间之后）",example = "2023-04-24")
    @NotNull(message = "请选择任务结束时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd")
    private LocalDate taskEndTime;

//    @Schema(description = "所需信誉值(不小于0)")
//    @NotNull(message = "{请输入信誉值}")
//    @PositiveOrZero(message = "{信誉值不能为负数}")
//    private Integer needReputation;

    @Schema(description = "带货商品列表(商品名)")
    @Size(min = 1,message = "请选择带货商品")
    @NotNull(message = "{请选择带货商品}")
    private List<SellTaskSaveChild> shopGoodsInfoList;

}
